/**
 * 
 */


/**
 * @author olle
 *
 */
public class MoveImpl extends CordImpl implements Move 
{
	
	private Direction direction;
	
	private String path;
	
	public MoveImpl( int x, int y, Direction direction, String path )
	{
		super(x,y);
		
		this.direction = direction;
		this.path = path;
	}
	
	public MoveImpl( Cord cord )
	{
		super( cord.getX(), cord.getY() );
		
		direction = null;
		path = "";
	}
	
	public MoveImpl( Cord cord, Direction direction )
	{
		this( cord );
		
		this.direction = direction;
	}

//	/* (non-Javadoc)
//	 * @see board.Move#getX()
//	 */
//	@Override
//	public int getX() 
//	{
//		return x;
//	}

	/* (non-Javadoc)
	 * @see board.Move#getY()
	 */


	/*
	 * TODO fusk!
	 */
	@Override
	public Move doNewMove(Direction direction) 
	{
		return new MoveImpl( getX() + direction.getXDiff(), getY() + direction.getYDiff(), direction, path );
	}
	
	@Override
	public MoveImpl clone()
	{
		return new MoveImpl( getX(), getY(), direction, path );
	}
	
	@Override
	public String toString()
	{
		return "x= "+getX()+", y= "+getY()+" ,direction= "+direction+ ", path= "+path;
	}

	@Override
	public Direction getDirectionToThis() 
	{
		return direction;
	}

	@Override
	public String getPathToThis() 
	{
		return path;
	}

}
